import time

import yagmail,logging,HTMLTestRunner_cn,pytest
def log():
    times=time.strftime('%Y%m%d_%H%M%S',time.localtime())
    logging.basicConfig(level=logging.DEBUG,
                        format='%(filename)s %(levelname)s %(message)s %(asctime)s %(lineno)d',
                        filename=f'hj+{times}+log',
                        filemode='w+')
def send_mail():
    msil=yagmail.SMTP(user='3034738910@qq.com',password='aytttpqxjbbrddjh',host='smtp.qq.com')
    msil.send(to='3034738910@qq.com',subject='测试报告',contents='测试报告')
if __name__ == '__main__':
    log()
    pytest.main([r'C:\Users\30347\PycharmProjects\pythonProject1\zhoukao3_0929\po\TestCase\TestCase.py','-s','--html=hj.html'])
    send_mail()